package com.dhcc.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhcc.entity.SysUserDepartmentInstitution;
import com.dhcc.mapper.SysUserDepartmentInstitutionMapper;
import com.dhcc.service.SysUserDepartmentInstitutionService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysUserDepartmentInstitutionServiceImpl extends ServiceImpl<SysUserDepartmentInstitutionMapper, SysUserDepartmentInstitution> implements SysUserDepartmentInstitutionService {
    @Resource
    private SysUserDepartmentInstitutionMapper sysUserDepartmentInstitutionMapper;
    @Override
    public List<String> getDepartment(String institutionId, String userId,String institutionRoleId) {
        List<String> departmentIds = sysUserDepartmentInstitutionMapper.getdepartment(institutionId, userId,institutionRoleId);
        return departmentIds;
    }

    @Override
    public List<String> getPositionIds(String institutionId, String departmentId, String userId,String institutionRoleId) {
        return sysUserDepartmentInstitutionMapper.getPositionIds(institutionId,departmentId,userId,institutionRoleId);
    }

    @Override
    public Integer updateUserPositionByUserId(String userId, String positionId) {
        return sysUserDepartmentInstitutionMapper.updateUserPositionByUserId(userId,positionId);
    }

    @Override
    public String selectAdminId(String institutionId, String institutionRoleId) {
        return sysUserDepartmentInstitutionMapper.selectAdminId(institutionId,institutionRoleId);
    }

    @Override
    public Integer addData(String userId, String institutionId, String departmentId, String positionId) {
        return sysUserDepartmentInstitutionMapper.addDate(userId,institutionId,departmentId,positionId);
    }

    @Override
    public List<String> selectPositionList(String institutionId, String institutionRoleId) {
        return sysUserDepartmentInstitutionMapper.selectPositionList(institutionId,institutionRoleId);
    }

    @Override
    public Integer insertPositionInforment(String institutionId, String institutionRoleId, String departmentId, String positionId) {
        return sysUserDepartmentInstitutionMapper.insertPositionInforment(institutionId,institutionRoleId,departmentId,positionId);
    }

    @Override
    public Integer deleteData(String institutionId, String institutionRoleId, String departmentId, String positionId) {
        return sysUserDepartmentInstitutionMapper.deleteData(institutionId,institutionRoleId,departmentId,positionId);
    }

    @Override
    public Integer deleteInstitutionData(String institutionId) {
        return sysUserDepartmentInstitutionMapper.deleteInstitutionData(institutionId);
    }

    @Override
    public Integer addInstitutionData(String userId, String institutionId, String departmentId, String positionId, String institutionRoleId) {
        return sysUserDepartmentInstitutionMapper.addInstitutionData(userId,institutionId,departmentId,positionId,institutionRoleId);
    }


}